{extend name="template/order" /}
{block name="content"}

<div class="page">
  <table class="table tb-type2 order">
    <tbody>
      <tr class="space">
        <th colspan="2">订单详情</th>
      </tr>
      <tr>
        <th>订单信息</th>
      </tr>
      <tr>
        <td colspan="2"><ul>
            <li>
            <strong>订单号:</strong><?php echo $order_info['order_sn'];?>
            ( 支付单号 ： <?php echo $order_info['pay_sn'];?> )
            </li>
            <li><strong>订单状态:</strong><?php echo orderState($order_info);?></li>
            <li><strong>订单总额:</strong><span class="red_common">&yen;<?php echo $order_info['order_amount'];?> </span>
             <!--//zmr>v80-->
             <?php if($order_info['rcb_amount']>0){ ?>
             <li><strong  style="color:blue">充值卡已支付:</strong><span class="red_common">&yen;<?php echo $order_info['rcb_amount'];?> </span>
              <?php } ?>
               <?php if($order_info['pd_amount']>0){ ?>
             
             
              <li><strong style="color:blue">预存款已支付:</strong><span class="red_common">&yen;<?php echo $order_info['pd_amount'];?> </span> <?php } ?>
              
              
            	<?php if($order_info['refund_amount'] > 0) { ?>
            	(退款:&yen;<?php echo $order_info['refund_amount'];?>)
            	<?php } ?></li>
            <li><strong>运费:</strong>&yen;<?php echo $order_info['shipping_fee'];?></li>
          </ul></td>
      </tr>
      <tr>
        <td><ul>
            <li><strong>买家：</strong><?php echo $order_info['buyer_name'];?></li>
            <li><strong>店铺：</strong><?php echo $order_info['store_name'];?></li>
            <li><strong>支付方式：</strong><?php echo orderPaymentName($order_info['payment_code']);?></li>
            <li><strong>下单时间：</strong><?php echo date('Y-m-d H:i:s',$order_info['add_time']);?></li>
            <?php if(intval($order_info['payment_time'])){?>
            <li><strong>支付时间：</strong><?php echo date('Y-m-d H:i:s',$order_info['payment_time']);?></li>
            <?php }?>
            <?php if(intval($order_info['shipping_time'])){?>
            <li><strong>发货时间：</strong><?php echo date('Y-m-d H:i:s',$order_info['shipping_time']);?></li>
            <?php }?>
            <?php if(intval($order_info['finnshed_time'])){?>
            <li><strong>完成时间：</strong><?php echo date('Y-m-d H:i:s',$order_info['finnshed_time']);?></li>
            <?php }?>
            <?php if($order_info['extend_order_common']['order_message'] != ''){?>
            <li><strong>买家附言：</strong><?php echo $order_info['extend_order_common']['order_message'];?></li>
            <?php }?>
          </ul></td>
      </tr>
      <tr>
        <th>收货人信息</th>
      </tr>
      <tr>
        <td><ul>
            <li><strong>收货人姓名：</strong><?php echo $order_info['extend_order_common']['reciver_name'];?></li>
            <li><strong>电话号码：</strong><?php echo @$order_info['extend_order_common']['reciver_info']['phone'];?></li>
            <li><strong>详细地址：</strong><?php echo @$order_info['extend_order_common']['reciver_info']['address'];?></li>
            <?php if($order_info['shipping_code'] != ''){?>
            <li><strong>发货单号：</strong><?php echo $order_info['shipping_code'];?></li>
            <?php }?>
          </ul></td>
          </tr>
    <?php if (!empty($daddress_info)) {?>
      <tr>
        <th>发货信息</th>
      </tr>
      <tr>
        <td><ul>
          <li><strong>发货人：</strong><?php echo $daddress_info['seller_name']; ?></li>
          <li><strong>电话号码:</strong><?php echo $daddress_info['telphone'];?></li>
          <li><strong>发货地：</strong><?php echo $daddress_info['area_info'];?>&nbsp;<?php echo $daddress_info['address'];?>&nbsp;<?php echo $daddress_info['company'];?></li>
          </ul></td>
          </tr>
    <?php } ?>
    <?php 
    if (!empty($order_info['extend_order_common']['invoice_info'])) {
    ?>
      <tr>
      	<th>发票信息</th>
      </tr>
      <tr>
      <td><ul>
    <?php foreach ((array)$order_info['extend_order_common']['invoice_info'] as $key => $value)
    {　
    ?>
      <li><strong><?php echo $key.$lang['nc_colon'];?></strong><?php echo $value;?></li>
    <?php } ?>
          </ul></td>
      </tr>
    <?php } ?>
      <tr>
        <th><?php echo $lang['product_info'];?></th>
      </tr>
      <tr>
        <td><table class="table tb-type2 goods ">
            <tbody>
              <tr>
                <th></th>
                <th>	商品信息</th>
                <th class="align-center">单价</th>
                <th class="align-center">实际支付额</th>
                <th class="align-center">数量</th>
                <th class="align-center">佣金比例</th>
                <th class="align-center">收取佣金</th>
              </tr>
              <?php foreach($order_info['extend_order_goods'] as $goods){?>
              <tr>
                <td class="w60 picture"><div class="size-56x56"><span class="thumb size-56x56"><i></i><a href="{:url('index/goods/detail?goods_id='.$goods['goods_id'])}" target="_blank"><img alt="产品图片" src="<?php echo img_url($goods['goods_image'], 60);?>" /> </a></span></div></td>
                <td class="w50pre"><p><a href="{:url('index/goods/detail?goods_id='.$goods['goods_id'])}" target="_blank"><?php echo $goods['goods_name'];?></a></p><p><?php echo orderGoodsType($goods['goods_type']);?></p></td>
                <td class="w96 align-center"><span class="red_common">&yen;<?php echo $goods['goods_price'];?></span></td>
                <td class="w96 align-center"><span class="red_common">&yen;<?php echo $goods['goods_pay_price'];?></span></td>
                <td class="w96 align-center"><?php echo $goods['goods_num'];?></td>
                <td class="w96 align-center"><?php echo $goods['commis_rate'] == 200 ? '' : $goods['commis_rate'].'%';?></td>
                <td class="w96 align-center"><?php echo $goods['commis_rate'] == 200 ? '' : ncPriceFormat($goods['goods_pay_price']*$goods['commis_rate']/100);?></td>
              </tr>
              <?php }?>
            </tbody>
          </table></td>
      </tr>
    <!-- S 促销信息 -->
      <?php if(!empty($order_info['extend_order_common']['promotion_info']) && !empty($order_info['extend_order_common']['voucher_code'])){ ?>
      <tr>
      	<th>其它信息</th>
      </tr>
      <tr>
          <td>
        <?php if(!empty($order_info['extend_order_common']['promotion_info'])){ ?>
        <?php echo $order_info['extend_order_common']['promotion_info'];?>，
        <?php } ?>
        <?php if(!empty($order_info['extend_order_common']['voucher_code'])){ ?>
        使用了面额为 ： <?php echo $order_info['extend_order_common']['voucher_price'];?> 元的代金券，
         编码 : <?php echo $order_info['extend_order_common']['voucher_code'];?>
        <?php } ?>
          </td>
      </tr>
      <?php } ?>
    <!-- E 促销信息 -->

    <?php if(is_array($refund_list) and !empty($refund_list)) { ?>
      <tr>
      	<th>退款记录</th>
      </tr>
      <?php foreach($refund_list as $val) { ?>
      <tr>
        <td>发生时间：<?php echo date("Y-m-d H:i:s",$val['admin_time']); ?>&emsp;&emsp;退款单号：<?php echo $val['refund_sn'];?>&emsp;&emsp;退款金额：&yen;<?php echo $val['refund_amount']; ?>&emsp;备注：<?php echo $val['goods_name'];?></td>
      </tr>
    <?php } ?>
    <?php } ?>
    <?php if(is_array($return_list) and !empty($return_list)) { ?>
      <tr>
      	<th>退货记录</th>
      </tr>
      <?php foreach($return_list as $val) { ?>
      <tr>
        <td>发生时间：<?php echo date("Y-m-d H:i:s",$val['admin_time']); ?>&emsp;&emsp;退货单号：<?php echo $val['refund_sn'];?>&emsp;&emsp;退款金额：&yen;<?php echo $val['refund_amount']; ?>&emsp;备注：<?php echo $val['goods_name'];?></td>
      </tr>
    <?php } ?>
    <?php } ?>
    <?php if(is_array($order_log) and !empty($order_log)) { ?>
      <tr>
      	<th>操作历史</th>
      </tr>
      <?php foreach($order_log as $val) { ?>
      <tr>
        <td>
          <?php echo $val['log_role']; ?> <?php echo $val['log_user']; ?>&emsp;于&emsp;<?php echo date("Y-m-d H:i:s",$val['log_time']); ?>&emsp;<?php echo $val['log_msg']; ?>
        </td>
      </tr>
      <?php } ?>
    <?php } ?>
    </tbody>
    <tfoot>
      <tr class="tfoot">
        <td><a href="JavaScript:void(0);" class="btn" onclick="history.go(-1)"><span>返回</span></a></td>
      </tr>
    </tfoot>
  </table>
</div>
{/block}
